package cloud.misiro.module.system.service.permission;

import cloud.misiro.module.system.dal.dataobject.permission.MenuDO;
import cloud.misiro.module.system.dal.mysql.permission.MenuMapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * 菜单 Service 实现
 *
 * @author misiro
 */
@Service
@Slf4j
public class MenuServiceImpl implements MenuService {

    @Resource
    private MenuMapper menuMapper;

    /**
     * 获得所有菜单列表
     *
     * @return 菜单列表
     */
    @Override
    public List<MenuDO> getMenuList() {
        return menuMapper.selectList();
    }

    /**
     * 获得菜单数组
     *
     * @param ids 菜单编号数组
     * @return 菜单数组
     */
    @Override
    public List<MenuDO> getMenuList(Collection<Long> ids) {
        return menuMapper.selectBatchIds(ids);
    }
}
